home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 247_02 / sample.c < prev    next >
Text File  |  1989-04-17  |  640b  |  28 lines

  1. /*
  2.  * Example program
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include "miracl.h"
  7.  
  8. main()
  9. { /* Brents example program */
  10.     flash x,pi;
  11.     mirsys(20,MAXBASE);
  12.     x=mirvar(0);
  13.     pi=mirvar(0);
  14.     POINT=ON;
  15.     printf("Calculating pi..\n");
  16.     fpi(pi);
  17.     cotnum(pi,stdout); /* output pi */
  18.     printf("Calculating exp(pi*(163/9)^0.5)\n");
  19.     fconv(163,9,x);
  20.     froot(x,2,x);
  21.     fmul(x,pi,x);
  22.     fexp(x,x);
  23.     cotnum(x,stdout);
  24.     printf("Calculating exp(pi*(163)^0.5)\n");
  25.     fpower(x,3,x);
  26.     cotnum(x,stdout);
  27. }
  28.